package com.example.doctorstation.POJOController;

import com.example.doctorstation.Config.MyResponse;
import com.example.doctorstation.POJOData.Diagnose;
import com.example.doctorstation.POJOMapper.DiagnoseMapper;
import lombok.Data;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author Victoria-Al
 * @date 2021-05-12
 * 描述：
 **/
@RestController
public class DiagnoseController {

    @Resource
    private DiagnoseMapper diagnoseMapper;

    @GetMapping("/getDiagnoseList")
    public MyResponse getDiagnoseList(LimitAndCount result) {
        // Map<String, Object> result = new HashMap<>();
        List<Diagnose> diagnoses = diagnoseMapper.getDiagnoseList(result.getOffset(), result.getLimit());

        // result.put("diagnoseList", diagnoses);
        return MyResponse.success(diagnoses);
    }

    @Data
    class LimitAndCount{
        private int limit;
        private int offset;
    }
}
